package cn.dianhun.om.jpa.pojo;

import lombok.ToString;

import javax.persistence.*;
import java.util.Objects;

/**
 * @author cyt
 * @create 2020-07-08 10:50
 */
@ToString
@Entity
@Table(name = "sys_menu", schema = "renren", catalog = "")
public class SysMenuEntity {
    @Id
    private long menuId;
    private Long parentId;
    private String name;
    private String url;
    private String perms;
    private Integer type;
    private String icon;
    private Integer orderNum;


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SysMenuEntity that = (SysMenuEntity) o;
        return menuId == that.menuId &&
                Objects.equals(parentId, that.parentId) &&
                Objects.equals(name, that.name) &&
                Objects.equals(url, that.url) &&
                Objects.equals(perms, that.perms) &&
                Objects.equals(type, that.type) &&
                Objects.equals(icon, that.icon) &&
                Objects.equals(orderNum, that.orderNum);
    }

    @Override
    public int hashCode() {
        return Objects.hash(menuId, parentId, name, url, perms, type, icon, orderNum);
    }
}
